﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;

public partial class Controls_ucInvest : System.Web.UI.UserControl
{
    string module_id;

    public string Module_id
    {
        get { return module_id; }
        set { module_id = value; }
    }
    private int counter;

    public int Counter
    {
        get { return counter; }
        set { counter = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadProduct();
        }
    }

    protected void loadProduct()
    {
        DataTable objDT = BO_Products.SelectByModule(1, 1, 3, Convert.ToInt32(module_id));
        if (objDT.Rows.Count > 0)
        {
            rptInvest.DataSource = objDT;
            rptInvest.DataBind();
        }
    }

    protected DataTable loadInvest(string product_id)
    {
        DataTable objDT = BO_Autions.SearchByProduct(Convert.ToInt32(product_id));
        return objDT;
    }

    protected string loadUrl(string url)
    {
        if (url.IndexOf("http://") > -1)
        {
            return url;
        }
        else
        {
            return "../upload/products/" + url;
        }
    }
}